package main

import (
	"fmt"

	"gitee.com/haifengat/gohs/def"
	hs "gitee.com/haifengat/gohs/lnx"
)

// 账号600600020密码308615，appid： client_ceshi_1.1    ，名字 ceshi    ，授权码： XJAUXJS78K42BP3P
// 18983893272  Wdl198348
func main() {
	q := hs.NewQuote()
	q.OnFrontConnected = func() {
		fmt.Println("connected.")
		q.ReqSubMarketData("rb2303")
	}
	q.OnRtnDepthMarketData = func(pDepthMarketData *def.CHSDepthMarketDataField) {
		fmt.Println(pDepthMarketData.InstrumentID)
	}
	// q.ReqConnect("tcp://118.26.194.226:8102", "./rd.dat")
	// q.ReqConnect("tcp://101.71.12.149:8102", "./rd.dat")
	q.ReqConnect("tcp://101.71.132.51:9106", "./rd.dat") // 期货 uat 7*24

	// t := hs.NewTrade()
	// t.on = func() {
	// 	fmt.Println("connected")
	// }
	// t.ReqConnect("tcp://118.26.194.226:8102")
	select {}
}
